﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaPoreznaOlaksica typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaPoreznaOlaksicaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaPoreznaOlaksicaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaPoreznaOlaksica _currentOsobaPoreznaOlaksica = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaPoreznaOlaksicaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaPoreznaOlaksicaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaPoreznaOlaksicaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Datum property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Opis property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOpisDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsnovaOsiguranjaTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsnovaOsiguranjaTipDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.OsnovaOsiguranjaTip> _IDOsnovaOsiguranjaTipList;
		
		/// <summary> 
		/// The list of selectable OsnovaOsiguranjaTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.OsnovaOsiguranjaTip> IDOsnovaOsiguranjaTipList
		{
			get {return this._IDOsnovaOsiguranjaTipList;}
			set 
			{
				this._IDOsnovaOsiguranjaTipList = value;
				this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DataSource = null;
				this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DataSource = this._IDOsnovaOsiguranjaTipList;
			}
		}
		
		private bool _allowNewItemInIDOsnovaOsiguranjaTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of OsnovaOsiguranjaTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsnovaOsiguranjaTipList
		{
			get { return _allowNewItemInIDOsnovaOsiguranjaTipList;}
			set
			{
				this._allowNewItemInIDOsnovaOsiguranjaTipList = value;
				this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaPoreznaOlaksica> _OsobaPoreznaOlaksicaList;
				
		/// <summary> 
		/// The list of OsobaPoreznaOlaksica to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaPoreznaOlaksica> OsobaPoreznaOlaksicaList
		{
			get {return this._OsobaPoreznaOlaksicaList;}
			set
			{
				this._OsobaPoreznaOlaksicaList = value;
				this.uxOsobaPoreznaOlaksicaBindingSource.DataSource = null;
				this.uxOsobaPoreznaOlaksicaBindingSource.DataSource = value;
				this.uxOsobaPoreznaOlaksicaDataGridView.DataSource = null;
				this.uxOsobaPoreznaOlaksicaDataGridView.DataSource = this.uxOsobaPoreznaOlaksicaBindingSource;				
				//this.uxOsobaPoreznaOlaksicaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaPoreznaOlaksicaBindingSource_ListChanged);
				this.uxOsobaPoreznaOlaksicaBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaPoreznaOlaksicaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaPoreznaOlaksicaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaPoreznaOlaksica = uxOsobaPoreznaOlaksicaBindingSource.Current as Entities.OsobaPoreznaOlaksica;
			
			if (_currentOsobaPoreznaOlaksica != null)
			{
				_currentOsobaPoreznaOlaksica.Validate();
			}
			//_OsobaPoreznaOlaksica.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaPoreznaOlaksicaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaPoreznaOlaksica"/> instance.
		/// </summary>
		public Entities.OsobaPoreznaOlaksica SelectedOsobaPoreznaOlaksica
		{
			get {return this._currentOsobaPoreznaOlaksica;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaPoreznaOlaksicaDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaPoreznaOlaksicaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaPoreznaOlaksicaDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaPoreznaOlaksicaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaPoreznaOlaksicaDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaPoreznaOlaksicaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaPoreznaOlaksicaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaPoreznaOlaksicaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaPoreznaOlaksicaDataGridViewBase"/> class.
		/// </summary>
		public OsobaPoreznaOlaksicaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaPoreznaOlaksicaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaPoreznaOlaksicaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaPoreznaOlaksicaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOpisDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			//this.uxIDOsnovaOsiguranjaTipBindingSource = new OsnovaOsiguranjaTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsnovaOsiguranjaTipBindingSource)).BeginInit();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaPoreznaOlaksicaErrorProvider
			// 
			this.uxOsobaPoreznaOlaksicaErrorProvider.ContainerControl = this;
			this.uxOsobaPoreznaOlaksicaErrorProvider.DataSource = this.uxOsobaPoreznaOlaksicaBindingSource;						
			// 
			// uxOsobaPoreznaOlaksicaDataGridView
			// 
			this.uxOsobaPoreznaOlaksicaDataGridView.AutoGenerateColumns = false;
			this.uxOsobaPoreznaOlaksicaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaPoreznaOlaksicaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxDatumDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxOpisDataGridViewColumn,
		this.uxIDOsnovaOsiguranjaTipDataGridViewColumn			});
			this.uxOsobaPoreznaOlaksicaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaPoreznaOlaksicaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaPoreznaOlaksicaDataGridView.Name = "uxOsobaPoreznaOlaksicaDataGridView";
			this.uxOsobaPoreznaOlaksicaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaPoreznaOlaksicaDataGridView.TabIndex = 0;	
			this.uxOsobaPoreznaOlaksicaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaPoreznaOlaksicaDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaPoreznaOlaksicaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaPoreznaOlaksicaDataGridViewDataError);
			this.uxOsobaPoreznaOlaksicaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaPoreznaOlaksicaDataGridViewCellValueNeeded);
			this.uxOsobaPoreznaOlaksicaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaPoreznaOlaksicaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDataGridViewColumn
			//
			this.uxDatumDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDataGridViewColumn.DataPropertyName = "Datum";
			this.uxDatumDataGridViewColumn.HeaderText = "Datum";
			this.uxDatumDataGridViewColumn.Name = "uxDatumDataGridViewColumn";
			this.uxDatumDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxOpisDataGridViewColumn
			//
			this.uxOpisDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOpisDataGridViewColumn.DataPropertyName = "Opis";
			this.uxOpisDataGridViewColumn.HeaderText = "Opis";
			this.uxOpisDataGridViewColumn.Name = "uxOpisDataGridViewColumn";
			this.uxOpisDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOpisDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOpisDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsnovaOsiguranjaTipDataGridViewColumn
			//
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DataPropertyName = "IDOsnovaOsiguranjaTip";
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.HeaderText = "IDOsnovaOsiguranjaTip";
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.Name = "uxIDOsnovaOsiguranjaTipDataGridViewColumn";
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsnovaOsiguranjaTipDataGridViewColumn
			//				
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsnovaOsiguranjaTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsnovaOsiguranjaTipDataGridViewColumn.DataSource = uxIDOsnovaOsiguranjaTipBindingSource;				
				
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaPoreznaOlaksicaDataGridView);
			this.Name = "OsobaPoreznaOlaksicaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsnovaOsiguranjaTipBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPoreznaOlaksicaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaPoreznaOlaksicaDataGridViewEventArgs args = new OsobaPoreznaOlaksicaDataGridViewEventArgs();
				args.OsobaPoreznaOlaksica = _currentOsobaPoreznaOlaksica;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaPoreznaOlaksicaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaPoreznaOlaksica	_OsobaPoreznaOlaksica;
	
			/// <summary>
			/// the  Entities.OsobaPoreznaOlaksica instance.
			/// </summary>
			public Entities.OsobaPoreznaOlaksica OsobaPoreznaOlaksica
			{
				get { return _OsobaPoreznaOlaksica; }
				set { _OsobaPoreznaOlaksica = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaPoreznaOlaksicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPoreznaOlaksicaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaPoreznaOlaksicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPoreznaOlaksicaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaPoreznaOlaksicaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].ID;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].IDOsoba;
						break;
					case "uxDatumDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].Datum;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].Iznos;
						break;
					case "uxOpisDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].Opis;
						break;
					case "uxIDOsnovaOsiguranjaTipDataGridViewColumn":
						e.Value = OsobaPoreznaOlaksicaList[e.RowIndex].IDOsnovaOsiguranjaTip;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaPoreznaOlaksicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPoreznaOlaksicaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaPoreznaOlaksicaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxDatumDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].Datum = (System.DateTime)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].Iznos = (System.Decimal)e.Value;
						break;
					case "uxOpisDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].Opis = (System.String)e.Value;
						break;
					case "uxIDOsnovaOsiguranjaTipDataGridViewColumn":
						OsobaPoreznaOlaksicaList[e.RowIndex].IDOsnovaOsiguranjaTip = (System.Int32)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
